#pragma once
#include <functional>
#include <iostream>

//任务形式1
using tast_t = std::function<void()>;

void DownLoad()
{
    std::cout << "下载任务" << std::endl;
}

//任务形式2
class Task
{
public:
    Task() {}
    Task(int a, int b)
     :_x(a), _y(b)
    {}

    int X() { return _x; }
    int Y() { return _y; }

    void Exec() { _res = _x + _y; }
    int Res() { return _res; }

private:
    int _x;
    int _y;
    int _res;
};